﻿using CPPEI.Coolzon.Event.NCL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CPPEI.Coolzon.DisplayApp.Windows
{
    public partial class SettingWindow
    {
        /// <summary>
        /// 收到修改控制状态的事件
        /// </summary>
        /// <param name="event"></param>
        [Common.Subscribe]
        public void OnReceiveNCLChangeControlStateEvent(NCLChangeControlStateEvent @event)
        {
            if (@event.State == NCLEventState.Sending)
            {
                this.Dispatcher.Invoke(() =>
                {
                    // 已发送，处理中。。。
                    _ctlControlPanel.IsEnabled = false;
                });
            }
            else
            {
                this.Dispatcher.Invoke(() =>
                {
                    // 处理完毕
                    _ctlControlPanel.IsEnabled = true;
                });
            }
        }
    }
}
